function my_ajax(api, method, params, call_back, error_call, direct_result) {
    if(params == null)
        params = {}
    params['TtzZ'] = Math.random();
    if(method.toUpperCase() == 'GET') {
        m = $.get;
    } else {
        m = $.post;
    }
    m(api, params, function(result, status) {
        if(status == 'success') {
            if(direct_result) {
                if(call_back != null)
                    call_back(result);
            } else {
                if(result.err_code == 0) {
                    if(call_back != null)
                        call_back(result.result);
                } else {
                    if(error_call == null)
                        alert(result.err_msg);
                    else
                        error_call(result);
                }
            }
        } else {
            alert('status: ' + status + '\nresponse: ' + result);
        }
    });
}
//    var fd = "";
//    for(var key in params) {
//        fd += "&" + key + "=" + encodeURI(params[key]);
//    }
//    if(fd.length > 0) {
//        fd = fd.substring(1)
//    }

var _get_result;

function my_result(url) {
    $.ajax({
        type: 'GET',
        async: false,
        url: url,
        timeout: 4000,
        processData: false,
        contentType: false,
        success: function(result) {
            if(result.err_code == 0) {
                _get_result = result.result;
            } else {
                alert(result.err_msg);
            }
        },
        error: function(e) {
            alert("异常: " + e);
        }
    });
    return _get_result;
}
